package primary;

import java.util.Comparator;
import java.util.HashMap;

/**
 * 自定义实习 set集合
 *
 * @param <T>
 */
public class L_HashSet<T> {
    HashMap map;
    private static final Object PERSENT = new Object();

    public L_HashSet() {

        map = new HashMap<T, Object>();
    }

    public int size() {
        return map.size();
    }

    public void add(T ele) {
        map.put(ele, PERSENT);
    }

    public T get(int index) {
        return (T) map.get(index);
    }

    public static void main(String[] args) {
        L_HashSet lset = new L_HashSet<String>();
        lset.add("add");
        lset.add("323");


    }


}

class L_HashSetComparetor<Integer> implements Comparator<java.lang.Integer> {

    public int compare(java.lang.Integer o1, java.lang.Integer o2) {
        return o1 - o2;
    }
}